package com.neuedu.corejava.ch3.homework1;

public class HollowRhombus {

	public static void main(String[] args) {
		//空心菱形
		int size = 5;
		for (int i = 1; i <= size; i++) {
			for (int j = 1; j <= size - i; j++) {
				System.out.print(" ");
			}
			for (int k = 1; k <= 2 * i - 1; k++) {
				if (k == 1 || k == 2 * i - 1) {
					System.out.print("*");
				} else {
					System.out.print(" ");
				}
			}
			System.out.println();
		}
 
		for (int i = 1; i < size; i++) {
			for (int j = 1; j <= i; j++)
				{System.out.print(" ");}
			int count = 2 * (size - i) - 1;
			for (int k = 0; k < count; k++) {
				if (k == 0 || k == count - 1)
					{System.out.print("*");}
				else
					{System.out.print(" ");}
			}
			System.out.println("");
		}
	}

}
